const SvgCaptcha = require("svg-captcha");
const express = require("express");
const captcha = express.Router();

captcha.get("/", function (req, res) {
    var instance = SvgCaptcha.create({
        size: 6,
        noise: 2,
        color: true,
        ignoreChars: "0o1i",
        fontSize: 50,
        background: "#ddd",
    });
    req.session.captcha = instance.text;
    res.send(instance.data);
});

module.exports = captcha;
